#ifndef RENDERCONTROLLER_H
#define RENDERCONTROLLER_H

#include <QObject>
#include <QPoint>
#include <QGLContext>
#include <QAction>
#include <QMap>
#include <QList>
#include <QPair>

class DirectionalLight;
class MainWindow;
class Object3D;
class Cubo;
class Cone;
class Sphere;

class ArcBall;

class GLDisplay;

class RenderController : public QObject
{
    Q_OBJECT

    GLDisplay *display;
    Object3D * model;
    Object3D * cubo;
    Object3D * sphere;
    Object3D * cone;
    Object3D * objeto;
    ArcBall* arcBall;
    DirectionalLight* light;
    bool wireframe;
    bool lightRotation;
    int tipoObjeto;

public:
    explicit RenderController(MainWindow *mainWindow,
                              QObject *parent = 0);
    ~RenderController();
    QGLWidget* getGLContext(void);
    void updateGL(void);
    QVector3D getLightPosition()const;



private:
    QString saveImage();

public slots:
    void drawModel();
    void mouseRigthMove(QPoint ini, QPoint curr);
    void mouseRigthFinish(QPoint ini, QPoint curr);
    void mouseLeftMove(QPoint ini, QPoint curr);
    void mouseLefthFinish(QPoint ini, QPoint curr);
    void mouseCancel();
    void wireFrameToggle(bool);
    void saveResultAsImage();
    void lightSetup(void);
    void lightRotationToggle(bool);
    void radioEvent(bool,bool,bool);
    void aplicaCores(int,int,int);
    void aplicaEscalas(float,float,float);
    void aplicaTranslacoes(double,double,double);
    void shaderLigado(bool);

};

#endif // RENDERCONTROLLER_H
